function genFile(o, solv)

solv = mycaffe.remove_empty_fields(solv);
solv = mycaffe.rmFields(solv, 'caffe_version');

%% create the solver file
% fid = 1;
fid = fopen(o.file, 'w');
fields = fieldnames(solv);
for i = 1 : length(fields)
    val = solv.(fields{i});
    % String value is included in "", except for: solver_mode: GPU/CPU
    if isnumeric(val)
        val = num2str(val);
    elseif ischar(val) && ~strcmpi(val, 'CPU') && ~strcmpi(val, 'GPU')
        val = sprintf('"%s"', val);
    end
    fprintf(fid, '%s: %s\n', fields{i}, val);
end

if fid ~= 1
    fclose(fid);
end

% clipboard('copy', ParamList);
